package com.whfc.openapi.api.fse.controller;

import com.whfc.common.result.Result;
import com.whfc.common.result.ResultUtil;
import com.whfc.fse.dto.FseBridgeDataDTO;
import com.whfc.fuum.dto.open.OpenApiClientDTO;
import com.whfc.openapi.api.fse.service.OpenApiFseBridgeService;
import com.whfc.openapi.constant.OpenApiConst;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @Description 架桥机开放接口
 * @Author hw
 * @Date 2021-10-08 10:43
 * @Version 1.0
 */
@RestController
@RequestMapping("/open/api/v1/fse/bridge")
public class FseBridgeController {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private OpenApiFseBridgeService openApiFseBridgeService;

    @PostMapping("/data/add")
    public Result dataAdd(@RequestAttribute(OpenApiConst.OPENAPI_CLIENT) OpenApiClientDTO openApiClientDTO, @RequestBody @Validated FseBridgeDataDTO param) {
        logger.info("开放平台新增架桥机实时数据,param：{}", param);
        openApiFseBridgeService.dataAdd(param);
        return ResultUtil.success();
    }
}
